Commit
e5c95b910d refactored the workspace animation to also handle
animations that involve all surrounding workspaces, but due to an
ill-advised review comment (guess whose) it broke the animation
for non-neighboring workspaces.
Update the code to handle correctly whether in a given direction:
- we have the target workspace of a given index
- we have a neighboring workspace
- we don't need to animate anything
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/182
let curWs = workspaceManager.get_workspace_by_index (from);
for (let dir of Object.values(Meta.MotionDirection)) {
- let ws = curWs.get_neighbor(dir);
- if (ws == curWs || (to >= 0 && ws.index() != to)) {
+ let ws = null;
+
+ if (to < 0)
+ ws = curWs.get_neighbor(dir);
+ else if (dir == direction)
+ ws = workspaceManager.get_workspace_by_index(to);
+
+ if (ws == null || ws == curWs) {
switchData.surroundings[dir] = null;
continue;
}